create table Viand
(
	 [ViandId] int identity(1, 1) primary key
	,[ViandName] nvarchar(128)
	,[CreatedBy] int
	,[CreatedDate] datetime
	,[UpdatedBy] int
	,[UpdatedDate] datetime
	,[Status] int
)
go

ALTER PROCEDURE ViandGet
	@ViandId int
AS
SELECT *
FROM [Viand]
WHERE [Viand].[ViandId] = @ViandId
GO

ALTER PROCEDURE ViandList
AS
SELECT *
FROM [Viand]
GO

ALTER PROCEDURE ViandInsert
	 @ViandName nvarchar(128)
	,@CreatedBy int
	,@CreatedDate datetime
	,@UpdatedBy int
	,@UpdatedDate datetime
	,@Status int
AS

INSERT INTO Viand (
	 [ViandName]
	,[CreatedBy]
	,[CreatedDate]
	,[UpdatedBy]
	,[UpdatedDate]
	,[Status]
	
) VALUES (
	 @ViandName
	,@CreatedBy
	,@CreatedDate
	,@UpdatedBy
	,@UpdatedDate
	,@Status
	
)

select SCOPE_IDENTITY()
GO

ALTER PROCEDURE ViandUpdate
	@ViandId int, 
	@ViandName nvarchar(128), 
	@CreatedBy int, 
	@CreatedDate datetime, 
	@UpdatedBy int, 
	@UpdatedDate datetime, 
	@Status int 

AS

UPDATE Viand SET
	   [ViandName] = @ViandName
	   ,[CreatedBy] = @CreatedBy
	   ,[CreatedDate] = @CreatedDate
	   ,[UpdatedBy] = @UpdatedBy
	   ,[UpdatedDate] = @UpdatedDate
	   ,[Status] = @Status
WHERE [Viand].[ViandId] = @ViandId
GO

ALTER PROCEDURE ViandDelete
	@ViandId int
AS
DELETE FROM Viand
WHERE [Viand].[ViandId] = @ViandId
GO